extends Node2D

@onready var character = $"../Character"
@onready var animated_sprite_2d = $AnimatedSprite2D
@onready var area_2d = $Area2D
signal ended

var has_triggered=0#只触发一次防止动画播放被打断
func _on_area_2d_body_entered(body):
	if has_triggered==0:
		has_triggered=1
		animated_sprite_2d.play("pressed")
		await animated_sprite_2d.animation_finished
		animated_sprite_2d.play("flagidle")
		await animated_sprite_2d.animation_finished
		ended.emit()
		has_triggered=0
		
	



